package com.niit.web.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.bean.NoteRepo;
import com.niit.bean.User;
import com.niit.service.NoteRepoService;
import com.niit.service.impl.NoteRepoServiceImpl;

@WebServlet("/Supply4NewNoteController")
public class Supply4NewNoteController extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		 User user = (User)request.getSession().getAttribute("user");//获取已登录的user

		// 获取笔记本仓库
		NoteRepoService nrs = new NoteRepoServiceImpl();
		List<NoteRepo> list = nrs.findReposByUser(user);
		
		request.setAttribute("list", list);
		request.getRequestDispatcher("/jsp/user/notebook/notebookedit.jsp")
				.forward(request, response);
	}

}
